package com.vito.demo.native.entity

import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.Id
import javax.persistence.Table

/**
 * Created by lingzhiyuan.
 * Date : 2016/11/15.
 * Time : 19:13.
 * Description:
 *
 */

@Entity
@Table(name = "user")
data class User(
        // Jackson和JPA需要使用一个无参的constructor
        // 当类中所有属性都具有默认值时，kotlin会自动生成一个无参的contructor

        @Id
        @GeneratedValue(strategy = javax.persistence.GenerationType.AUTO)
        var id: Long = 0,
        var name: String = ""
               )